<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 16/9/13
 * Time: 下午6:23
 */

namespace app\admin\controller;


use think\Controller;
use think\Db;
use think\Session;
use think\Request;

class FeedBack extends Controller
{

    public function __construct(Request $request)
    {
        parent::__construct($request);
        if (!Session::get("login")){
            $this->error("请登录","User/login");
        }
    }

    public function feedlist(){
        $act = Request::instance()->param('act');
        $id = Request::instance()->param('id');
        if ($act && $id){
            switch ($act){
                case 'disable':
                    Db::name('feedback')->update(['status'=>0,'id'=>$id]);
                    break;
            }
        }
        $data = Db::name('feedback')->order('id','desc')->where('status',1)->select();
        $this->assign('feeds',$data);
        return view();
    }

}